import java.util.ArrayList;
import java.util.Collections;

public class Collection {
    public static void main(String[] args) {
        ArrayList list = new ArrayList();
        list.add(16);
        list.add(15);
        list.add(14);
        list.add(1);

        Collections.swap(list,1,3);     //交换元素方法
        System.out.println(list);

        ArrayList list1 = new ArrayList();
        for (int i = 0; i <4 ; i++) {
            list1.add(i);
        }
        Collections.copy(list1,list);
        System.out.println(list1);

    }
}
